const info = {
  schema: 1,
  id: "pythoncore-3.14-64",
  "sort-version": "3.14.0b4",
  company: "PythonCore",
  tag: "3.14-dev-64",
  "install-for": ["3.14.0b4-64", "3.14-64", "3-64", "3.14-dev-64", "3-dev-64"],
  alias: [
    {
      target: "python.exe",
      name: "python3.14.exe",
    },
    {
      target: "python.exe",
      name: "python3.14-64.exe",
    },
    {
      target: "python.exe",
      name: "python3.exe",
    },
    {
      target: "python.exe",
      name: "python3-64.exe",
    },
    {
      target: "pythonw.exe",
      windowed: 1,
      name: "pythonw3.14.exe",
    },
    {
      target: "pythonw.exe",
      windowed: 1,
      name: "pythonw3.14-64.exe",
    },
    {
      target: "pythonw.exe",
      windowed: 1,
      name: "pythonw3.exe",
    },
    {
      target: "pythonw.exe",
      windowed: 1,
      name: "pythonw3-64.exe",
    },
  ],
  "display-name": "Python 3.14.0b4",
  executable: ".\\python.exe",
  url: "https://www.python.org/ftp/python/3.14.0/python-3.14.0b4-amd64.zip",
  hash: {
    sha256: "67523e872e5b9c421f74d159200c34f0c4148b44fc479ac12d2a64a99f666b9d",
  },
};

const sortVersion = info["sort-version"];
const revision = sortVersion.match(/[a-zA-Z]\d+$/)?.[0];
const version = revision ? sortVersion.slice(0, sortVersion.length - revision.length) : sortVersion;
const result = [info.company.toLowerCase(), version, revision].filter(it => !!it).join("-");
console.log(result);
